///PHILOTES Source Code.  (C)2012 PhiloLabs
#pragma once

#ifndef __StaticFaceGroup_H__
#define __StaticFaceGroup_H__

#include "OgrePrerequisites.h"

#include "math/plane.h"
#include "OgrePatchSurface.h"

namespace Ogre {
	
    enum FaceGroupType {
        FGT_FACE_LIST,
        FGT_PATCH,
        FGT_UNKNOWN
    };
    
    struct StaticFaceGroup {
        // Type of face group.
        FaceGroupType fType;

        /// Is this a sky surface?
        bool isSky;

        
        int vertexStart;

        int numVertices;

        int elementStart;

        int numElements;

        int materialHandle;

        Plane plane;

        /// Patch surface (only applicable when fType = FGT_PATCH)
        PatchSurface* patchSurf;


        _OgreExport friend std::ostream& operator<<(std::ostream& o, const StaticFaceGroup& s)
        {
            o << "StaticFaceGroup(";
            if (s.fType == FGT_FACE_LIST)
            {
                o << "faceList, numVertices=" << s.numVertices << ", vertexStart=" << s.vertexStart;
                o << ", numElements=" << s.numElements << ", elementStart=" << s.elementStart;
                o << ", normal=" << s.plane.normal;
            }
            else if (s.fType == FGT_PATCH)
            {
                o << "bezierPatch, numVertices=" << s.numVertices << ", vertexStart=" << s.vertexStart;
                // TODO
            }

            o << ", materialHandle=" << s.materialHandle;
            o << ")";

            return o;
        }


    };
	
	

} // namespace

#endif
